import store from '@/store/index'
import * as modelData from '@/model/data'
import config from '@/config/index'
import { navigateTo } from './tools'
import { eventBlockApi } from './event/eventLib'
import * as utils from '@/utils/index'
import * as message from '@/utils/message'
import Vue from 'vue'
import {
  locToken,
  locAccount,
  locPassword,
  locBaseSet
} from '@/utils/locStore/data'

// 移除默认地理位置
export function clearAll() {
  store.dispatch('clearAll', '')
}
export function setChooseFilmName(name) {
  store.dispatch('setChooseFilmName', name)
}
export function getChooseFilmName() {
  return store.getters.chooseFilmName
}
export function getGlobalDialog() {
  return store.getters.globalDialog
}
export function setGlobalDialog(val) {
  store.dispatch('setGlobalDialog', val)
}
// 获取基础设置
export function getBaseSet(flag = true) {
  return utils.debounce(toGetBaseSet, [flag])
}
export function toGetBaseSet(flag = true) {
  const has = hasLocBaseSet()
  if (has && !flag) {
    const baseSet = getLocBaseSet()
    return Promise.resolve(baseSet)
  } else {
    return uni.$api.channel.baseSet().then((res) => {
      if (res.defaultCity) {
        // 只有一个城市的时候
        const { id, regionName } = res.defaultCity
        if (id && regionName) {
          console.log('一个城市')
          saveChooseAreaInfo({ cityId: id, regionName })
        }
      }
      store.dispatch('setBaseSet', res)
      return Promise.resolve(res)
    })
  }
}
// 是否有基础设置
export function hasLocBaseSet() {
  return !!Object.keys(getLocBaseSet()).length
}
// 获取 基础设置
export function getLocBaseSet() {
  const data = store.state.baseSet || locBaseSet.get()
  return utils.deep(data)
}

export function miniCode() {
  return new Promise((resolve) => {
    // #ifdef MP-WEIXIN
    wx.login({
      success: (res) => {
        resolve(res.code)
      }
    })
    // #endif
  })
}

// 清除用户信息
export function clearUserInfo() {
  store.dispatch('setUserInfo', '')
}
// 清除token
export function clearToken() {
  store.dispatch('setToken', '')
  // #ifdef MP-ALIPAY
  getApp().globalData.token = ''
  // #endif
}

export function saveToken(token) {
  // #ifdef MP-ALIPAY
  getApp().globalData.token = token
  // #endif
  store.dispatch('setToken', token)
}
export function getToken(refresh = false) {
  return utils.debounce(toGetToken, [refresh])
}
export function toGetToken(refresh = false) {
  // 获取token方法
  const token = getLocToken()
  console.log('toGetToken', token)
  if (!token || refresh) {
    return uni.$api.public.getToken().then((res) => {
      const tokenId = res.tokenId || ''
      saveToken(tokenId)
      return Promise.resolve(tokenId)
    })
  }
  return Promise.resolve(token)
}
// 获取本地token
export function getLocToken() {
  let loct = ''
  // #ifdef MP-ALIPAY
  loct = getApp().globalData.token
  // #endif
  const token = loct || store.getters.token || locToken.get() || ''
  return utils.deep(token)
}
// 获取用户信息(请求接口)  flag  处理 先判断是否已登录请求用户信息
export function getUserInfo(flag = false) {
  return utils.debounce(toGetUserInfo, [flag])
}

export function toGetUserInfo(flag = false, mode = '') {
  if (!flag && !getIslogin()) {
    return Promise.reject({ status: 10001, mgs: '未登录' })
  }
  return uni.$api.user.userInfo({ mode }).then((res) => {
    saveUserInfo(res)
    return res
  })
}

// 获取是否登录
export function getIslogin() {
  return !!getLocUserInfo().memberId
}
// 存储用户信息
export function saveUserInfo(info) {
  store.dispatch('setUserInfo', info)
}
// 获取本地用户信息
export function getLocUserInfo() {
  const userInfo = store.getters.userInfo || {}
  return utils.deep(userInfo)
}

export const setDataDictionary = () => {
  store.dispatch('setBaseData', { ...modelData })
}

//退出登录
export const handleLogout = (redirect?: string) => {
  //先清vuex中状态
  store.dispatch('setUserInfo', '') //注意清store
  clearToken()
  toGetToken(true).then((res) => {
    //重新获取新token并且跳转登录页重新登录验证
    console.log('获取到的token', res, redirect)
    // 'reLaunch'
    navigateTo('/pages/login/index', { redirect }, 'navigateTo')
  })
}

export const watchBlockApi = () => {
  const app = getApp()
  const blockApi = app?.globalData?.blockApi
  if (!blockApi) {
    // 释放api阻塞
    return Promise.resolve()
  }
  return new Promise((resolve) => {
    // 开启监听 触发emit时候才会执行
    eventBlockApi.once((data) => {
      resolve(data)
    })
  })
}

export const handelBlockApi = (app) => {
  app.globalData.blockApi = true // 开启阻塞api
  toGetAccount(true)
    .then(() => {
      toGetBaseSet(true).then(() => {
        toGetToken(true)
          .then(() => {
            emitEvent(true)
          })
          .catch(() => {
            emitEvent(false)
          })
      })
    })
    .catch(() => {
      emitEvent(false)
    })
}
function emitEvent(flag: boolean) {
  getApp().globalData.blockApi = false
  const isSingle = getSingleModel()
  console.log('isSingle', isSingle)
  if (isSingle) {
    getAreaInfo(true)
  }
  if (!flag) {
    locToken.remove()
  }
  eventBlockApi.emit({ isLogin: flag })
}

// 获取客服电话
export const getServiceTel = () => {
  const data = getLocBaseSet()
  return data.serviceTel
}
export const safeBottom = (that) => {
  uni.getSystemInfo({
    success: (res: any) => {
      // 底部安全距离
      that.globalData.safeBottom = Math.abs(res.safeAreaInsets.bottom)
    }
  })
}

export const platform = () => {
  return process.env.VUE_APP_PLATFORM
}
export const validateTel = (val) => {
  const Reg = /^1[3456789]\d{9}$/
  return Reg.test(val)
}
// 当前真实定位位置,只在定位成功时候被赋值
export function saveLoctionAreaInfo(info) {
  store.dispatch('setLocAreaInfo', info)
}
// 获取存储的真实当前地理位置
export function getLoctionAreaInfo() {
  const locAreaInfo = store.getters.locAreaInfo
  return utils.deep(locAreaInfo)
}
// 当前手动选择/系统默认的地理位置
export function saveChooseAreaInfo(areaInfo) {
  console.log('areaInfo,', areaInfo)
  // 防止空地址赋值
  areaInfo.cityId ? store.dispatch('setChooseAreaInfo', areaInfo) : ''
}
// 获取存储的手动选择/系统默认地理位置
export function getChooseAreaInfo() {
  const areaInfo = store.getters.areaInfo
  return utils.deep(areaInfo)
}
// 是否有地理位置信息
export function hasAreaInfo() {
  return !!getChooseAreaInfo().cityId
}
// 获取最新地理位置
export function getAreaInfo(refresh = false) {
  return utils.debounce(toGetAreaInfo, [refresh])
}
export function getMapGuide(lat: any, lng: any, name: any, address: any) {
  uni.openLocation({
    latitude: +lat,
    longitude: +lng,
    name: name,
    address: address
  })
}
export function toGetAreaInfo(refresh = false) {
  console.log('toGetAreaInfo')
  return new Promise((resolve) => {
    const has = hasAreaInfo() // 判断是否存在定位
    if (has && !refresh) {
      resolve(getChooseAreaInfo())
    } else {
      const areaInfo = getChooseAreaInfo() || config.areaInfo
      uni.getLocation({
        // #ifdef MP-WEIXIN || H5
        type: 'gcj02',
        // #endif
        success(resp) {
          console.log('接口请求定位')
          message.loading()
          uni.request({
            url: 'https://map.zmaxfilm.com/',
            data: {
              type: 'gcj02',
              lng: resp.longitude,
              lat: resp.latitude
            },
            success(res) {
              message.hideLoading()
              const data = res.data as any
              const address = data.result
                ? data.result.addressComponent
                : config.addressComponent
              const addressDesc = data.result
                ? data.result.formatted_address
                : config.formatted_address
              const provinceName = address.province
              const cityName = address.city
              const areaName = address.district
              const countryId = address.districtCode
              const shortName = provinceName + cityName
              const areaInfo = {
                cityId: address.cityCode,
                regionName: cityName,
                provinceName,
                provinceId: address.provinceCode,
                areaName,
                countryId,
                addressDesc,
                shortName,
                lng: resp.longitude.toString(),
                lat: resp.latitude.toString()
              }
              console.log('store.getters.areaInfo', store.getters.areaInfo)
              //第一次进入没选择城市定位后赋值，其余情况不做覆盖，避免主动选择后又被修改
              if (!(store.getters.areaInfo && store.getters.areaInfo.cityId)) {
                saveChooseAreaInfo(areaInfo)
              }
              saveLoctionAreaInfo(utils.deep(areaInfo))
              judgeLocation()
              resolve(areaInfo)
            },
            fail() {
              message.hideLoading()
              saveChooseAreaInfo(areaInfo)
              resolve(areaInfo)
            }
          })
        },
        fail(err) {
          console.log('fail', err, areaInfo)
          saveChooseAreaInfo(areaInfo)
          if (err.errMsg === 'getLocation:fail auth deny') {
            message.toast('打开定位服务,提供更好的服务')
          } else if (platform() === 'mp-alipay') {
            if (err && err.message) {
              message.toast(err.message)
            }
          }
          resolve(areaInfo)
        }
      })
    }
  })
}

// function getRealLoc(resolve) {
//   if (max > 5) {
//     clearTimeout(areaTimer)
//     areaTimer = null
//     return
//   }
//   areaTimer = setTimeout(() => {
//     const areaInfo = getLoctionAreaInfo()
//     if (areaInfo && Object.keys(areaInfo).length > 0) {
//       const has = hasAreaInfo()
//       !has && saveChooseAreaInfo(areaInfo)
//       resolve(areaInfo)
//     } else {
//       max++
//       getRealLoc(resolve)
//     }
//   }, 200)
// }

/**
 * @description 定位判断
 */
export const judgeLocation = () => {
  const chosenLocation = getChooseAreaInfo()
  const realyLocation = getLoctionAreaInfo()
  const hasShowModel = store.getters.hasShowModel
  if (
    !hasShowModel &&
    chosenLocation &&
    chosenLocation.cityId &&
    realyLocation.cityId &&
    realyLocation
  ) {
    console.log('判断城市定位是否一致--')
    const baseSet = getLocBaseSet() || {}
    store.dispatch('setHasShowModel', true)
    // 判断真实定位是否是在接口返回的城市中，多影城才需要
    const index =
      baseSet && baseSet.cityId && baseSet.cityId.indexOf(realyLocation.cityId)
    if (
      chosenLocation.cityId !== realyLocation.cityId &&
      getSingleModel() &&
      index !== -1
    ) {
      Vue.nextTick(() => {
        setTimeout(() => {
          message
            .showModal({
              content: `当前页面地理位置为【${chosenLocation.regionName}】，是否切换回【${realyLocation.regionName}】？`
            })
            .then(() => {
              saveChooseAreaInfo(realyLocation)
              removeLocCinemaInfo()
              toGetBaseSet(true).then(() => {
                reloadPage()
              })
            })
            .finally(() => {
              store.dispatch('setHasShowModel', false)
            })
        }, 300)
      })
    } else {
      store.dispatch('setHasShowModel', false)
    }
  }
}
/**
 * @description 重载页面
 */
function reloadPage() {
  const pages = getCurrentPages()
  if (pages && pages.length > 0) {
    const perpage = pages[pages.length - 1]
    // #ifdef H5
    uni.redirectTo({
      url: perpage.$page.fullPath
    })
    // #endif
    // #ifndef H5
    const query = Object.keys(perpage.options).map(
      (i) => i + '=' + perpage.options[i]
    )
    const routeUrl = perpage.route.split('/')
    const url =
      routeUrl[routeUrl.length - 1] +
      (query && query.length > 0 ? '?' + query.join('&') : '')
    console.log(url)
    uni.redirectTo({
      url
    })
    // #endif
  }
}
export function setAccount(account) {
  locAccount.set(account)
  // #ifdef MP-ALIPAY
  getApp().globalData.account = account
  // #endif
}
export function setPwd(password) {
  locPassword.set(password)
  // #ifdef MP-ALIPAY
  getApp().globalData.password = password
  // #endif
}

// h5调用其他小程序在store中调用
export function getAccount(refresh = false) {
  //获取渠道账号
  // 获取account-防抖
  return utils.debounce(toGetAccount, [refresh])
}
export function getLocAccount() {
  console.log('getLocAccount', locAccount.get())
  //获取本地存储渠道账号
  let loc = ''
  // #ifdef MP-ALIPAY
  loc = getApp().globalData.account
  // #endif
  const account = loc || locAccount.get() || config.account || ''

  return account
}

export function getMiniAppId() {
  let miniAppId = ''
  // #ifdef MP-ALIPAY
  miniAppId = config.alipayMiniAppId || ''
  // #endif
  // #ifdef MP-TOUTIAO
  miniAppId = tt.getEnvInfoSync().microapp.appId || config.ttAppId || ''
  // #endif
  // #ifdef MP-WEIXIN
  miniAppId =
    wx.getAccountInfoSync().miniProgram.appId || config.miniAppId || ''
  // #endif
  return miniAppId
}
export function toGetAccount(refresh = false) {
  const account = getLocAccount()
  const password = getPwd()
  if (!account || refresh) {
    const query = {
      stopBlockApi: true, //wait 阻塞
      miniAppId: getMiniAppId()
    }
    return uni.$api.public.getAccount(query).then((res) => {
      setAccount(res.account)
      setPwd(res.password)
      return Promise.resolve(res)
    })
  }
  return Promise.resolve({ account, password })
}

export function getPwd() {
  //获取渠道密码
  let locP = ''
  // #ifdef MP-ALIPAY
  locP = getApp().globalData.password
  // #endif
  const password = locP || locPassword.get() || config.password || ''
  return password
}

// [0]无需实名[1]座位需要与实名信息一一对应[2]提供至少一张至多座位数张数的实名信息
export function memberSystemStatus() {
  const baseSet = getLocBaseSet() || {}
  return baseSet.memberSystemStatus
}
export function getRealNameStatus() {
  const baseSet = getLocBaseSet() || {}
  return baseSet.realNameStatus + ''
}
// 获取实名认证提示
export function getRealNameAg() {
  const baseSet = getLocBaseSet() || {}
  return baseSet.realNameAg || ''
}
export function getSingleModel() {
  // true 多影城  false 单影城
  const baseSet = getLocBaseSet() || {}
  return baseSet.isSingleModel === '0'
}
export function getBaseSetCity() {
  const baseSet = getLocBaseSet() || {}
  return baseSet.cityId && baseSet.cityId.split(',')[0]
}
export function getBaseSetLogo() {
  const baseSet = getLocBaseSet() || ''
  return baseSet && baseSet.logo
}
export function getBaseSetAllCity() {
  const baseSet = getLocBaseSet() || {}
  return baseSet.cityId
}
// 获取当前位置影院
export function getCinemaInfo(refresh = false, type = 'save') {
  return utils.debounce(toGetCinemaInfo, [refresh, type])
}
// 获取本地CinemaInfo
export function getLocCinemaInfo() {
  const cinemaInfo = store.getters.cinemaInfo
  return utils.deep(cinemaInfo)
}
export function removeLocCinemaInfo() {
  store.dispatch('setCinemaInfo', '')
}
export function toGetCinemaInfo(refresh = false, type = 'save') {
  console.log('toGetCinemaInfo', refresh, type)
  // 获取cinema方法
  const cinemaInfo = getLocCinemaInfo()
  //
  if (!cinemaInfo.cinemaId || refresh) {
    const d = {
      longitude: '',
      latitude: ''
    }
    const locationAreaInfo = getLoctionAreaInfo() || {}
    const areaInfo = getChooseAreaInfo() || {}
    if (locationAreaInfo.cityId === areaInfo.cityId || !areaInfo.cityId) {
      //带经纬度用于返回最近的影院
      d.longitude = '' + locationAreaInfo.lng
      d.latitude = '' + locationAreaInfo.lat
    }

    return uni.$api.cinema.cinemaList(d).then((res) => {
      console.log('==========2ci')
      const firstCinemaInfo = (res.length > 0 && res[0]) || {}
      // const cinemaInfo = (res.length > 0 && res[0]) || {}
      if (type === 'save') {
        //切换城市后默认选择第一个影城
        saveCinemaInfo(firstCinemaInfo)
      } else if (type === 'update') {
        let _cinemaInfo = ''
        if (cinemaInfo.cinemaId) {
          _cinemaInfo = res.find(
            (item) => item.cinemaId === cinemaInfo.cinemaId
          )
        }
        _cinemaInfo
          ? saveCinemaInfo(_cinemaInfo)
          : saveCinemaInfo(firstCinemaInfo)
      }
      //选择默认影城后设置该影城城市为默认城市
      saveChooseAreaInfo({
        cityId: firstCinemaInfo.cityId,
        regionName: firstCinemaInfo.city
      })
      return Promise.resolve(cinemaInfo)
    })
  }
  return Promise.resolve(cinemaInfo)
}
export function saveCinemaInfo(info) {
  store.dispatch('setCinemaInfo', utils.deep(info))
}
export function removeAll() {
  store.dispatch('setUserInfo', '')
  store.dispatch('setCinemaInfo', '')
  store.dispatch('setHasShowModel', '')
  store.dispatch('setBaseData', '')
  store.dispatch('setTabbarData', '')
  store.dispatch('setBaseSet', '')
  store.dispatch('setChooseAreaInfo', '')
  store.dispatch('setLocAreaInfo', '')
  store.dispatch('setPosterInfo', '')
  store.dispatch('setChooseFilmName', '')
  // #ifdef MP-ALIPAY
  getApp().globalData.uId = ''
  // #endif
}
export function logout(cb) {
  // 注销登录
  return uni.$api.public.loginout().then((res) => {
    clearToken()
    clearUserInfo()
    console.log('退出登录')
    if (!cb) {
      navigateTo('/pages/login/index', {}, 'reLaunch')
    } else {
      cb()
    }
    return res
  })
}
//分享后参数处理
export function getShareQuery(option) {
  console.log(option, '====option===')
  // const qrCode = option.scene
  // 1 scene  2 sq  3 无参数
  const type = option && option.scene ? 'scene' : option.sq ? 'sq' : ''
  console.log(option, 'shareQueryObj option')
  if (type) {
    let shareQueryObj: any = {}

    shareQueryObj =
      type === 'scene'
        ? decodeURIComponent(option.scene).split(',')
        : decodeURIComponent(option.sq).split(',')
    console.log('shareQueryObj', shareQueryObj)
    let memberId = shareQueryObj[0]
    let mallCommodityId = shareQueryObj[3]
    if (memberId === 'undefined') {
      memberId = ''
    }
    if (mallCommodityId === 'undefined') {
      mallCommodityId = ''
    }
    //   type === 'scene' ? shareQueryObj[0].split('=')[1] : shareQueryObj[0]

    const shareInfo = {
      memberId: memberId,
      showUser: shareQueryObj[1],
      uId: shareQueryObj[2],
      mallCommodityId: mallCommodityId || '',
      url: shareQueryObj[4] || '',
      opt: (shareQueryObj[5] && shareQueryObj[5].replace(/-/g, ',')) || '',
      registerActivityId: shareQueryObj[6] || ''
    }
    // getInvite(shareInfo)

    store.dispatch('setPosterInfo', shareInfo)
    // #ifdef MP-ALIPAY
    getApp().globalData.uId = shareInfo.uId
    getApp().globalData.registerActivityId = shareInfo.registerActivityId
    // #endif
    return shareInfo
  } else {
    store.dispatch('setPosterInfo', { ...store.state.share, showUser: !!type })
    // #ifdef MP-ALIPAY
    getApp().globalData.uId = store.state.share.uId
    getApp().globalData.registerActivityId =
      store.state.share.registerActivityId
    // #endif
    return {}
  }
}
// 存储选择实名认证数据
export function setRealNameList(data) {
  uni.setStorageSync('realNameList', data)
}

export function getRealNameList() {
  return uni.getStorageSync('realNameList')
}

export function removeNameList() {
  uni.removeStorageSync('realNameList')
}

// 获取分享相关信息
export function getShareInfo(obj) {
  // const hasId = obj.id ? `,${obj.id}` : ''
  const hasId = obj.id
  const str = `${obj.memberId || ''},${obj.showUser || ''},${obj.uId || ''},${
    hasId || ''
  },${obj.jumpUrl || ''},${obj.opt || ''},${obj.registerActivityId || ''}`
  // const distSource = Encrypt(JSON.stringify(obj))
  const shareQuery = str
  // const jumpUrl = ['normal', 'coupon'].includes(obj.type)
  //   ? 'pages/goodDetail/index'
  //   : 'pages/index/index'
  const jumpUrl = 'pages/index/index'

  return { shareQuery, jumpUrl }
}

// 新增分享次数
export function getShareCount() {
  uni.$api.share.shareCount()
  // uni.$api.activity.getInviteActivity().then((res) => {
  //   if (res && res.id) {
  //     uni.$api.activity.partInInviteActivity({ activityId: res.id })
  //   }
  // })
  return Promise.resolve()
}

export function getDeviceType() {
  let type = ''
  //#ifdef H5
  type = 'h5'
  //#endif
  //#ifdef MP-WEIXIN
  type = 'wxxcx'
  //#endif
  //#ifdef MP-ALIPAY
  type = 'ali'
  //#endif
  //#ifdef MP-TOUTIAO
  type = 'douyin'
  //#endif
  return type
}
export function setTabBarItem() {
  console.log('setTabBarItem')
  // api.setTabBarItem().then((res) => {

  // })
  // const res = [
  //   {
  //     pagePath: '/pages/index/index',
  //     iconPath: 'static/img/tabbar/ticket.png',
  //     selectedIconPath: 'static/img/tabbar/ticket_select.png',
  //     text: '推荐',
  //     visible: true
  //   },
  //   {
  //     pagePath: '/pages/ticket/ticket',
  //     iconPath: 'static/img/tabbar/cinema.png',
  //     selectedIconPath: 'static/img/tabbar/cinema_select.png',
  //     text: '电影',
  //     visible: true
  //   },
  //   {
  //     pagePath: '/pages/mall/mall',
  //     iconPath: 'static/img/tabbar/mall.png',
  //     selectedIconPath: 'static/img/tabbar/mall_select.png',
  //     text: '特惠',
  //     visible: false
  //   },
  //   {
  //     pagePath: '/pages/mall/mallBuy',
  //     iconPath: 'static/img/tabbar/mall.png',
  //     selectedIconPath: 'static/img/tabbar/mall_select.png',
  //     text: '点餐',
  //     visible: true
  //   },
  //   {
  //     pagePath: '/pages/mine/index',
  //     iconPath: 'static/img/tabbar/my.png',
  //     selectedIconPath: 'static/img/tabbar/my_select.png',
  //     text: '我的',
  //     visible: true
  //   }
  // ]
  // res.forEach((item, index) => {
  //   const barItem = {
  //     index,
  //     pagePath: item.pagePath,
  //     text: item.text,
  //     iconPath: item.iconPath,
  //     selectedIconPath: item.selectedIconPath,
  //     visible: item.visible
  //   }
  //   console.log('barItem', barItem)
  //   uni.setTabBarItem(barItem)
  // })
  uni.hideTabBar()
}
export default {
  getBaseSetLogo,
  getDeviceType,
  // reomveDefaultAreaInfo,
  toGetBaseSet,
  getBaseSet,
  hasLocBaseSet,
  getLocBaseSet,
  clearUserInfo,
  clearToken,
  saveToken,
  getToken,
  toGetToken,
  getLocToken,
  getBaseSetAllCity,
  getUserInfo,
  toGetUserInfo,
  getIslogin,
  saveUserInfo,
  getLocUserInfo,
  getServiceTel,
  setDataDictionary,
  handleLogout,
  watchBlockApi,
  handelBlockApi,
  // checkLogin,
  reloadPage,
  safeBottom,
  platform,
  validateTel,
  getAreaInfo,
  toGetAreaInfo,
  setChooseFilmName,
  getChooseFilmName,
  hasAreaInfo,
  getChooseAreaInfo,
  saveChooseAreaInfo,
  saveLoctionAreaInfo,
  // getSystemInfo,
  getAccount,
  toGetAccount,
  getLocAccount,
  getPwd,
  getLoctionAreaInfo,
  getRealNameStatus,
  getRealNameAg,
  getSingleModel,
  getCinemaInfo,
  miniCode,
  getLocCinemaInfo,
  toGetCinemaInfo,
  saveCinemaInfo,
  getMapGuide,
  logout,
  getShareInfo,
  setRealNameList,
  getRealNameList,
  removeNameList,
  getShareQuery,
  getShareCount,
  clearAll,
  removeAll,
  setTabBarItem
}
